<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml"
	>
	
	<ui:define name="body">
		<p:messages for="suceso" />
		<h:form prependId="false">
			<p:toolbar>
				<p:toolbarGroup align="left">
					<p:commandButton value="#{messages['boton.guardar']}" action="#{libradorEditMB.insert()}"
						rendered="#{!libradorEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['boton.guardar']}" action="#{libradorEditMB.update()}"
						rendered="#{libradorEditMB.updateMode}" ajax="false" />
					<p:commandButton value="#{messages['boton.eliminar']}" onclick="confirmation.show()"
						rendered="#{libradorEditMB.updateMode}" type="button" immediate="true" ajax="false" />
					<p:commandButton value="#{messages['boton.volver']}"  onclick="location.href='/financiero/librador_list.jsf'"  
						rendered="#{libradorEditMB.updateMode}" type="button"/>
					<p:commandButton value="#{messages['boton.volver']}"  onclick="location.href='/financiero/index.jsf'" 
						rendered="#{!libradorEditMB.updateMode}" type="button"/>
					
					<p:confirmDialog message="#{messages['label.confirmar.eliminar']}"
						header="#{messages['label.dialogo.titulo.eliminar']}" severity="alert" widgetVar="confirmation"
						width="295" height="80"
						>
						<p:commandButton value="#{messages['boton.dialogo.si']}" action="#{libradorEditMB.delete()}" immediate="true"
							ajax="false" />
						<p:commandButton value="#{messages['boton.dialogo.no']}" onclick="confirmation.hide()" type="button" />
					</p:confirmDialog>
					
				</p:toolbarGroup>
			</p:toolbar>

			<br />
			<div align="center">
			<p:fieldset style="width: 60%;" legend="#{messages['librador.label']}">
				<p:focus context="fields"/> 
				<h:panelGrid id="fields" columns="3">
					<p:outputLabel value="#{messages['librador.label.codigo']}: " for="codigo" styleClass="text-input" />
					<p:inputText id="codigo" value="#{libradorEditMB.bean.codigo}" maxlength="7"
						title="#{messages['librador.alt.codigo']}" required="true" requiredMessage="#{messages['general.mensaje.requerido']}"/>
					<p:message for="codigo" />
					
					<p:outputLabel value="#{messages['librador.label.descripcion']}: " for="description" styleClass="text-input" />
					<p:inputText id="description" value="#{libradorEditMB.bean.descripcion}" maxlength="255"
						title="#{messages['librador.alt.descripcion']}" required="true" requiredMessage="#{messages['general.mensaje.requerido']}"/>
					<p:message for="description" />
					
					<p:outputLabel value="#{messages['librador.label.notas']}: " for="notas" styleClass="text-input" />
					<p:inputText id="notas" value="#{libradorEditMB.bean.notas}" maxlength="255"
						title="#{messages['librador.alt.notas']}" required="true" requiredMessage="#{messages['general.mensaje.requerido']}"/>
					<p:message for="notas" />
					
					<p:outputLabel value="#{messages['librador.label.limiteCredito']}: " for="limiteCredito" styleClass="text-input" />
					<p:inputText id="limiteCredito" value="#{libradorEditMB.bean.limiteCredito}" maxlength="12"
						title="#{messages['librador.alt.limiteCredito']}" required="true" requiredMessage="#{messages['general.mensaje.requerido']}"/>
					<p:message for="limiteCredito" />
				</h:panelGrid>
			</p:fieldset>
			</div>
		</h:form>
	</ui:define>
</ui:composition>